-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support event APIs #339
Support event APIs #339
Conversation
c0cceee
to
ba76a8d
Compare
components/inx/server_utxo.go
Outdated
func (s *Server) ReadOutputMetadata(_ context.Context, id *inx.OutputId) (*inx.OutputMetadata, error) { | ||
outputID := id.Unwrap() | ||
|
||
output, spent, err := deps.Protocol.MainEngineInstance().Ledger.OutputOrSpent(outputID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhh so we don't have any info about the latest commitment in the Ledger?
Because between fetching the output from the ledger, and reading the latestCommitment
from the SyncManager.... there could be a change. We need this info atomically.
Otherwise we return the wrong latestCommitmentId.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we only have it in Storage and SyncManager. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ledgerstate has the index, but when we read this we go through the mempool which has a potentially newer state than the ledgerstate. That is why it is important to compare the slot indexes in the output metadata with the latest commitment of the node, that way you will see if the output was committed or if it is still just in the mempool
Changes are also made in:
inx-mqtt
docker image can be packed and successfully tested in docker-network.Close #227